<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<f:view>
	<f:event listener="#{viewController.init}" type="preRenderComponent"></f:event>
	<h:head>
		<title>#{msgs.welcomeTo} #{msgs.webSiteName}</title>
		<h:outputStylesheet library="css" name="common.css" />
		<h:outputStylesheet library="css" name="admin.css" />
	</h:head>
	<h:body>


		<div id="logo" style="position: relative; float: right;">
			<h:form id="logoForm">
				<p:commandLink type="submit"
					action="../index.xhtml?faces-redirect=true">
					<h:graphicImage library="images" name="logo.png"
						style="height:50px;width:300px;border:0px;float:right" />
				</p:commandLink>
			</h:form>
		</div>
		<div id="header">
			<h:form id="headerForm">
				<h:panelGrid columns="4">
					<p:menubar style="float:left">
						<p:submenu label="Product">
							<p:menuitem value="Information" url="/admin/product.xhtml" />
							<p:menuitem value="Sales" url="/admin/order.xhtml" />
							<p:menuitem value="Telephone order" url="/admin/newOrder.xhtml" />
							<p:menuitem value="Purchases" url="/admin/purchase.xhtml"></p:menuitem>
							<p:menuitem value="Inventory" url="/admin/productInventory.xhtml"></p:menuitem>
							<p:menuitem value="Price info" url="/admin/productPrice.xhtml"></p:menuitem>
							<p:menuitem value="Weekly" url="/admin/weekly.xhtml"></p:menuitem>
							<p:menuitem value="Theme" url="/admin/productTheme.xhtml"></p:menuitem>
							<p:submenu label="Others">
								<p:menuitem value="Who buy it" url="/admin/whobuyit.xhtml"></p:menuitem>
								<p:menuitem value="Flyer" url="/admin/flyer.xhtml"></p:menuitem>
								<p:menuitem value="Promotion" url="/admin/promotion.xhtml"></p:menuitem>
								<p:menuitem value="Tofu" url="/admin/tofu.xhtml"></p:menuitem>
								<p:menuitem value="Organic" url="/admin/organic.xhtml"></p:menuitem>
							</p:submenu>
						</p:submenu>
						<p:submenu label="System">
							<p:menuitem value="User" url="/admin/user.xhtml" />
							<p:menuitem value="Role" url="/admin/role.xhtml" />
							<p:menuitem value="Supplier" url="/admin/supplier.xhtml" />
							<p:menuitem value="Location" url="/admin/location.xhtml" />
							<p:menuitem value="Picture" url="/admin/picture.xhtml" />
							<p:menuitem value="System Maintenance"
								url="/admin/system/systemMaintenance.xhtml" />
						</p:submenu>

						<p:submenu label="Interation">
							<p:menuitem value="Messages" url="/admin/message.xhtml" />
							<p:menuitem value="Faq" url="/admin/faq.xhtml" />
							<p:menuitem value="Feed back" url="/admin/feedBack.xhtml" />
						</p:submenu>

						<p:submenu label="Report">
							<p:menuitem value="Sales"
								url="/admin/report/orderDetailSummary.xhtml" />
							<p:menuitem value="Customer paid summary"
								url="/admin/report/salesGroupByUser.xhtml" />
							<p:menuitem value="Product sales summary"
								url="/admin/report/salesGroupByProduct.xhtml" />
							<p:menuitem value="Prepare and Deliver"
								url="/admin/report/prepareAndDeliver.xhtml" />
							<p:menuitem value="User Activity"
								url="/admin/report/userActivityRecordReport.xhtml" />
						</p:submenu>
					</p:menubar>
					<h:selectOneMenu value="#{viewController.language}"
						onchange="submit()">
						<f:selectItems value="#{userModel.availableLanguages}"
							var="language" itemValue="#{language}"
							itemLabel="#{language.label}"></f:selectItems>
					</h:selectOneMenu>

					<ui:remove>
						<p:selectBooleanCheckbox value="#{viewController.isShowAdminList}">Show List
					<p:ajax event="change" update=":listForm,:detailForm"></p:ajax>
						</p:selectBooleanCheckbox>
						<p:selectBooleanCheckbox
							value="#{viewController.isShowAdminDetail}">Show Detail
					<p:ajax event="change" update=":listForm,:detailForm"></p:ajax>
						</p:selectBooleanCheckbox>
					</ui:remove>

					<p:ajaxStatus>
						<f:facet name="start">
							<h:graphicImage
								value="../resources/images/icons/system/wait30trans.gif" />
						</f:facet>
						<f:facet name="complete">
							<h:outputText value="   "></h:outputText>
						</f:facet>
					</p:ajaxStatus>
					<p:growl id="growl" showDetail="true" life="5000" globalOnly="true" />
				</h:panelGrid>
			</h:form>

			<p:ajaxStatus onstart="statusDialog.show();"
				onsuccess="statusDialog.hide();" />

			<p:dialog modal="true" widgetVar="statusDialog" draggable="false"
				closable="false">
				<h:panelGrid columns="2">
					<h:graphicImage library="images" name="icons/system/globe32.gif" />
					<h:outputText value="#{msgs.processing}" style="color:green;"></h:outputText>
				</h:panelGrid>
			</p:dialog>
		</div>

		<div id="content">
			<ui:insert name="content"></ui:insert>
		</div>
	</h:body>
</f:view>

</html>
